package priority_queue;

import queue.Queue;

public class PriorityQueue  implements Queue<Integer> {

    private MaxHeap heap;

    public PriorityQueue(){
        heap=new MaxHeap();
    }

    @Override
    public void offer(Integer val) {
        heap.add(val);
    }

    @Override
    public Integer poll() {
        return heap.extractMax();
    }

    @Override
    public Integer peek() {
        return heap.peekMax();
    }

    @Override
    public boolean isEmptty() {
        return heap.isEmpty();
    }
}
